package cn.tangsihai.controller;

import cn.tangsihai.domain.User;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * 用户返回接口
 */
@RestController
public class UserController {
    // 获取配置文件中的指定数据
    @Value("${server.port}")
    private int port;

    @GetMapping("/getById/{id}")
    public User getId(@PathVariable("id") Long id){
        return new User(id , "我是张三, port=" + port);
    }
}
